package com.pi.shisan.service.constants;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 闹铃类型
 */
@Getter
@AllArgsConstructor
public enum ClockTypeEnum {

    NO_REPEAT(0,"不重复"),
    BETWEEN_TIME(1,"间隔分钟数重复"),
    DIY(2,"自定义"),
    CHINA_VACATION(3,"法定节假日"),
    CHINA_OFFICE(4,"法定工作日"),
    MOTHER_DAY(5,"母亲节"),
    FATHER_DAY(6,"父亲节"),
    LUNAR_BIRTHDAY(7,"农历生日"),
    ;
    private final int type;
    private final String des;

    public static ClockTypeEnum getClockType(Integer type) {
        if (type == null || type < 0) {
            return null;
        }
        ClockTypeEnum[] values = values();
        if (type >= values.length) {
            return null;
        }
        return values[type];
    }
}
